package com.plian.system.entity.qg.subsidiary;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.plian.Tools.DateUtil;
import com.plian.system.mybatis.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

/**
 * 子企业混合所有制改革进展实体类
 *
 * @author jianglei
 * @since 2019-11-05
 */
@Data
@TableName("qg_subsidiary_mixed_reform")
@EqualsAndHashCode(callSuper = true)
@ApiModel("引进非市级国有资本")
public class SubsidiaryMixedReform extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("单据编码")
    private String code;

    @ApiModelProperty("混改企业id - 产权id")
    private String mixedEnterpriseId;

    @ApiModelProperty("所属集团全称")
    private String affiliatedOrgFullName;

    @ApiModelProperty("企业级次")
    private String unitRankId;

    @ApiModelProperty("所属行业")
    private String majorIndustryId;

    @TableField(exist = false)
    private List<String> majorIndustryIds;

    @ApiModelProperty("功能分类")
    private String functionalCategoryId;

    @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
    @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
    @TableField(value = "implementation_time", updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "首次混改日期", required = true)
    private Date implementationTime;

    @ApiModelProperty(value = "混改方式 多个,分割", required = true)
    private String mixedModeId;

    @TableField(exist = false)
    private List<String> mixedModeIds;

    @ApiModelProperty(value = "具体方式（混改方式为其他时 必填）", required = true)
    private String otherIntroduce;

    @ApiModelProperty(value = "混改类型", required = true)
    private String mixedType;

    @ApiModelProperty("混改后企业类别")
    private String mixedCategoryId;

    @ApiModelProperty("与国家出资企业的关系 编码126")
    private String stateFundedRelation;

    @TableField(value = "registered_capital",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty("注册资本")
    private BigDecimal registeredCapital;

    @ApiModelProperty(value = "子企业数", required = true)
    private Integer subsidiaryNum;

    @TableField(value = "introduce_capital_amount",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "引入非市级国有资本金额（万元）(reformType=2，3时必填)", required = true)
    private BigDecimal introduceCapitalAmount;

    @TableField(value = "introduce_capital_ratio",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "引入非市级国有资本占比(reformType=2，3时必填)", required = true)
    private BigDecimal introduceCapitalRatio;

    @TableField(value = "nonpublic_capital_ratio",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "民营资本占比（%）(reformType=1,3时必填)", required = true)
    private BigDecimal nonpublicCapitalRatio;

    @TableField(value = "nonpublic_capital_amount",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "引入民营资本金额(reformType=1,3时必填)", required = true)
    private BigDecimal nonpublicCapitalAmount;

    @TableField(value = "employee_sharingholding_nums",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "员工持股人数(reformType=1,3时必填)", required = true)
    private Integer employeeSharingholdingNums;

    @TableField(value = "employee_stock_ratio",updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "员工持股比例(reformType=1,3时必填)", required = true)
    private BigDecimal employeeStockRatio;
    /**
     * 联系人
     */
    private String contacts;
    /**
     * 联系方式
     */
    private String contactInformation;

    @ApiModelProperty(value = "版本号")
    private Integer version;

    @ApiModelProperty(value = "上个版本id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long lastVersionId;

    @ApiModelProperty(value = "初始版本id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long initialId;

    @ApiModelProperty(value = "是否最新 1否2是")
    private Integer isLatest;

    @ApiModelProperty(value = "混改类型 1引进民营资本信息 2引进非市级国有资本 3同时引进", required = true)
    private Integer reformType;

    @ApiModelProperty(value = "混改状态  1可引用状态  2变更审批中 3处置审批中 4处置审批完")
    private Integer reformStatus;

    @DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
    @JsonFormat(pattern = DateUtil.PATTERN_DATE)
    @TableField(value = "change_time", updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "变更日期（变更操作必填）", required = true)
    private Date changeTime;

    @ApiModelProperty(value = "注销原因（注销操作必填）", required = true)
    private String outReason;

    @DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
    @JsonFormat(pattern = DateUtil.PATTERN_DATE)
    @ApiModelProperty(value = "注销时间（注销操作必填）", required = true)
    private Date outTime;

    @ApiModelProperty(value = "注销 备注")
    private String outRemark;

    @ApiModelProperty(value = "注销方式（1产权注销、2混改注销）")
    private Integer outType;
    /**
     * 审批人
     */
    private String approvedUser;
    /**
     * 审批时间
     */
    @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
    @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
    private Date approvedTime;
    /**
     * 审批意见
     */
    private String approvedOpinion;
    /**
     * 乐观锁字段
     */
    private Integer tsVersion;
    /**
     * 审批流主键
     */
    private String formType;

    /**
     * 混改后企业股权结构
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "子表数据", required = true)
    private List<MixedOwnershipStructure> mixedOwnershipStructures;

    @TableField(exist = false)
    @ApiModelProperty(value = "附件")
    private List<HashMap> docList;

    //老数据同步用
    /**
     * 混改后注册资本（万元）
     */

    private BigDecimal mixedRegisteredCapital;

    @TableField(exist = false)
    private BigDecimal introduceRegisteredCapital;

    @ApiModelProperty(value = "数据来源 null为系统填报 对应用户id")
    private String dataSource;

    @ApiModelProperty(value = "数据来源id", required = true)
    private String dataSourceId;

    @ApiModelProperty(value = "是否三江汇海：0-否，1-是", required = true)
    private Integer isThree;
}